package com.cicro.provider;

import com.cicro.common.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class RegisterController {

    @PostMapping("/register")
    public String register(@RequestBody User user) {
        return "redirect:http://provider/login?username=" + user.getUsername();

    }

    @GetMapping("/login")
    @ResponseBody
    public String login(String username) {
        System.out.println("1111");
        return "username"+username;

    }
}
